SetThemePen
NEW WITH THE APPEARANCE MANAGER
Sets an element's pen pattern or color to comply with the current theme.
pascal OSStatus SetThemePen ( ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice);
inBrush
- A value representing the pattern or color to which the pen is to be set; see "Appearance-Compliant Brush Type Constants".
inDepth
- The bit depth (in pixels) of the current graphics port.
inIsColorDevice
- A Boolean value. Set to
true
to indicate that you are drawing on a color device. Set tofalse
for a monochrome device.- function result
- A result code. The result code
appearanceBadBrushIndexErr
indicates that the brush constant passed in was not valid. For a list of other result codes, see "Result Codes".DISCUSSION
TheSetThemePen
function should be called each time you wish to draw an element in a specified brush constant using Appearance Manager draw functions.The constant in the
inBrush
parameter can represent a color or pattern, depending on the current theme. Because it could specify a pattern, remember to save and restore thepnPixPat
andbkPixPat
fields of your graphics port when saving the text and background colors. Because patterns in thepnPixPat
field override the foreground color of the window, call the Window Manager functionPenPat
to set your foreground pattern to a normal white pattern. This will ensure that you can useRGBForeColor
to set your foreground color to white, call the Window Manager functionPaintRect
, and get the expected results.